#ifndef __WENX_DISPLAY__
#define __WENX_DISPLAY__

void initLED_OLED();
void initGPIO();
void initPWR();

void initLED_OLED()
{
	MCF_GPIO_PTHPAR=0x00;//All PTH used as GPIO
	MCF_GPIO_DDRTH=0xFF;//All as output pin
	MCF_GPIO_SETTH=0xFF;//Set all pins
	//LEDs
	//OLEDs
	MCF_GPIO_PTCPAR|=MCF_GPIO_PTCPAR_DTIN0_GPIO;
	MCF_GPIO_DDRTC|=MCF_GPIO_DDRTC_DDRTC0;
	MCF_GPIO_SETTC|=MCF_GPIO_SETTC_SETTC0;
	
	MCF_GPIO_PTEPAR=0x00;
}

void initGPIO()
{
	MCF_GPIO_DDRTE=0x00;
	MCF_GPIO_PTEPAR=0x00;	
}

void initPWR()
{
	MCF_SCM_PPMRL=MCF_SCM_PPMRL_CDMINIBUS|
				MCF_SCM_PPMRL_CDDMA|
				MCF_SCM_PPMRL_CDUART2|
				MCF_SCM_PPMRL_CDRTC|
				MCF_SCM_PPMRL_CDDTIM0|
				MCF_SCM_PPMRL_CDDTIM1|
				MCF_SCM_PPMRL_CDDTIM2|
				MCF_SCM_PPMRL_CDDTIM3|
				MCF_SCM_PPMRL_CDFEC;
	MCF_SCM_PPMRH=MCF_SCM_PPMRH_CDUSB;
}

#endif